package com.zzf.networktest

import java.lang.RuntimeException

class Max {
}

fun <T:Comparable<T>>max(vararg nums:T):T{
    if (nums.isEmpty()) throw RuntimeException("nums参数不能为空")
    var maxNum = nums.first()
    for (num in nums){
        if (num>maxNum){
            maxNum = num
        }
    }
    return maxNum
}